Repository navigation
Read number plates locally with Ultralytics OCR instead of OpenAI - #121
Conversation
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Reviewed the OCR notebook rewrite, catalog metadata, and README entries. The processing flow and OCR result handling are consistent; no concrete regressions found. LGTM.
|
🎉 This PR is merged—thank you, @glenn-jocher! The notebook now demonstrates local plate recognition with Ultralytics’ OCR solution instead of sending plate crops to OpenAI.
|
The ANPR notebook now reads plates with the Ultralytics OCR solution (
solutions.OCR, PP-OCRv6 on ONNX Runtime) instead of sending every plate crop in every frame to OpenAIgpt-4o-mini. It runs offline, needs no API key, and costs nothing per frame.Changes
solutions.OCR(model="anpr-demo-model.pt", imgsz=640). The demo plate detector feeds the same detection-then-recognition path as YOLO26-Text, and the solution draws each plate's text on the frame. This replaces the OpenAI client, the prompt, the base64 encoding and the manual crop/annotate loop.how-to-use-ultralytics-yolo-with-openai-for-number-plate-recognition.ipynbtohow-to-use-ultralytics-yolo-ocr-for-number-plate-recognition.ipynb. Only this repo linked to the old path (org-wide code search).docs/notebooks-data.ymlentry and its README rows. The GPT-4o blog and YouTube links are dropped because they describe the old approach, and the documentation link now points to the OCR guide.anpr-yolo-ocr-output.jpg, uploaded to thev0.0.0release next to the other notebook images.Validation
I ran the notebook's code cells as written (Python 3.12, ultralytics 8.4.215, Apple CPU, ONNX Runtime 1.32):
anpr-demo-video.mp4and wroteanpr-output.avi.8884KA-4(0.97–1.00),3066MP-4(1.00),AP 4895-5(0.95–0.99).🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
The ANPR notebook now uses Ultralytics’ OCR solution to recognize detected plates locally and updates its name and documentation links accordingly.
📊 Key Changes
gpt-4o-mini, its API client, and manual crop/encoding/annotation code withsolutions.OCR(model="anpr-demo-model.pt", imgsz=640)and the PP-OCRv6 recognizer.anpr-output.avi.docs/notebooks-data.yml; the documentation link now points to the OCR guide.🎯 Purpose & Impact